<#include "/admin/common/header.ftl">
<link href="/css/page/memberDetail.css" rel="stylesheet">
<link href="/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<body>
<div class="member-info with-padding">
    <div class="base-info-container ui-member-container">
        <div class="base-info-title">
            <h3 class="member-block">基本信息</h3>
        </div>
        <div class="base-info-content">
            <div class="info-img">
                <img src="${member.headImg!}" onerror="this.src='/image/no_pic.png'" alt="头像">
            </div>
            <div class="info-pr">
                <div class="label-list">
                    <span class="bot">昵称：${member.name!}</span>
	                <#if memberRank??>
                        <div class="inline-block">
                            <span class="label-list-item green">${memberRank.rankName!}</span>
                        </div>
	                </#if>
                    <#if member.isAdmin?? && member.isAdmin>
                        <div class="inline-block">
                            <span class="label-list-item red">管理员</span>
                        </div>
                    </#if>
                </div>
                <div class="zent-row row-line">
                    <div class="zent-col zent-col-6 col-line col-line-left">生日：${(member.birthday?date)!}</div>
                    <div class="zent-col zent-col-12 col-line col-line-left">手机号：${member.mobile!}</div>
                </div>
                <div class="zent-row row-line">
                    <div class="zent-col zent-col-6 col-line col-line-left">性别：${member.sexS!}</div>
                    <div class="zent-col zent-col-18 col-line">常住地：${member.province!} ${member.city!}</div>
                </div>
            </div>
        </div>
    </div>
    <div class="asset-info-container ui-member-container">
        <h3 class="member-block">资产信息</h3>
        <ul class="asset-info-content">
            <li class="asset-item">
                <div class="center-content">
                    <span class="asset-bot split">当前积分</span>
                    <div class="inline-block">
                        <span class="like-link" onclick="giveMemberPoints()">赠送</span>
                    </div>
                    <span class="like-link asset-num" onclick="memberPointsHistory()">${member.memberPoints!}</span>
                </div>
            </li>
            <li class="asset-item">
                <div class="center-content">
                    <span class="asset-bot">可用优惠券数</span><br>
                    <span class="like-link asset-num" onclick="memberCouponList()">${couponNum!}</span>
                </div>
            </li>
            <li class="asset-item">
                <div class="center-content">
                    <span class="asset-bot split">账户余额</span>
                    <div class="inline-block">
                        <span class="like-link" onclick="giveMemberBalance()">充值</span>
                    </div>
                    <span class="like-link asset-num" onclick="memberBalanceHistory()">${(member.memberBalance?string.currency)!}</span>
                </div>
            </li>
        </ul>
    </div>
    <div class="member-info-container ui-member-container">
        <h3 class="member-block">会员权益</h3>
        <ul class="member-info-content">
            <li class="member-item">
                <div class="member-icon member-icon-postage"></div>
                <p class="member-context"><#if postage??&&(postage?number>0) > 满${postage!}包邮<#else>全场包邮</#if></p>
            </li>
            <li class="member-item">
                <div class="member-icon member-icon-discount"></div>
                <p class="member-context">会员折扣</p>
            </li>
            <li class="member-item">
                <div class="member-icon member-icon-points"></div>
                <p class="member-context">积分</p>
            </li>
            <li class="member-item">
                <div class="member-icon member-icon-coupon"></div>
                <p class="member-context">优惠券</p>
            </li>
        </ul>
    </div>
    <div class="trade-info-container ui-member-container">
        <div class="trade-title">
            <h3 class="member-block">交易统计</h3>
            <span class="like-link" onclick="memberOrderList()">订单列表</span>
        </div>
        <div class="trade-info-content">
            <li class="trade-item">
                <div class="center-warp"><span class="trade-bot">最近下单时间</span><br><span class="trade-num">${lastOrderTime!}</span></div>
            </li>
            <li class="trade-item">
                <div class="center-warp"><span class="trade-bot">累计消费金额</span><br><span class="trade-num">${(orderTotalMoney?string.currency)!}</span>
                </div>
            </li>
            <li class="trade-item">
                <div class="center-warp"><span class="trade-bot">累计消费订单数</span><br><span class="trade-num">${orderCount!}</span></div>
            </li>
            <li class="trade-item">
                <div class="center-warp"><span class="trade-bot">累计退款金额</span><br><span class="trade-num">￥0.00</span>
                </div>
            </li>
            <li class="trade-item">
                <div class="center-warp"><span class="trade-bot">累计退款订单数</span><br><span class="trade-num">0</span></div>
            </li>
        </div>
    </div>
</div>
<#include "/admin/common/footer.ftl">
<script src="/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script type="text/javascript">
    var memberId = "${member.memberId!}";

    var dlg = new $.zui.ModalTrigger({
        backdrop: 'static'
    });

    function giveMemberPoints() {
        dlg.show({remote: '/admin/member/giveMemberPoints?memberId=' + memberId});
    }

    function giveMemberBalance() {
        dlg.show({remote: '/admin/member/giveMemberBalance?memberId=' + memberId});
    }

    function memberCouponList() {
        dlg.show({remote: '/admin/member/memberCouponList?memberId=' + memberId});
    }

    function memberPointsHistory() {
        dlg.show({remote: '/admin/member/memberAccountLog?accountType=1&memberId=' + memberId});
    }

    function memberBalanceHistory() {
        dlg.show({remote: '/admin/member/memberAccountLog?accountType=3&memberId=' + memberId});
    }

    function memberOrderList() {
        location.href = "/admin/order/orderList?memberId=" + memberId;
    }
</script>
</body>
</html>